<title>商户列表</title>
<div class="layui-fluid">
    <!--查询-->
    <div class="layui-col-md12">
        <form class="layui-form layui-col-md11">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="searchName" placeholder="请输入商户名称"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-input-inline">
                    <a class="layui-btn" lay-submit lay-filter="find">查询</a>
                </div>
            </div>
        </form>
        <a class="layui-btn layui-col-md1" lay-submit lay-filter="record">套餐购买记录</a>
    </div>
    <!--数据表格-->
    <div class="layui-col-md12">
        <table id="pageTable" lay-filter="pageTable" lay-data="{id: 'pageTable'}"></table>
    </div>
    <!--商户应用列表-->
    <div class="layui-col-md12" style='display:none;' id="app_form">
        <table id="pageTableApp" lay-filter="pageTableApp" lay-data="{id: 'pageTableApp'}"></table>
    </div>
    <form class="layui-form" id="buy" style="display: none;">
        <div class="layui-form-item order_combo_list" style="margin-top: 1.25rem; display: none;">
            <label class="layui-form-label">订单套餐</label>
            <div class="layui-input-inline order_combo" style="width: 350px;"></div>
        </div>
        <div class="layui-form-item validity_time">
            <label class="layui-form-label">到期时间</label>
            <div class="layui-input-inline">
                <input name="validity_time" id="validity_time" required lay-verify="required" placeholder="请选择时间"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item number_recharge" style="margin-top: 1.25rem;">
            <label class="layui-form-label">数量充值</label>
            <div class="layui-input-inline">
                <input name="number" value="0" required autocomplete="off" lay-verify="required" placeholder="请输入充值数量"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <a class="layui-btn" lay-submit lay-filter="sub">提交</a>
            </div>
        </div>
    </form>
    <!--应用数量弹出框-->
    <form id="app_number" style="display: none;">
        <div class="layui-form-item" style="margin-top: 1.25rem;">
            <label class="layui-form-label">应用数量</label>
            <div class="layui-input-inline">
                <input name="app_number" required autocomplete="off" lay-verify="required" placeholder="请输入应用数量"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <a class="layui-btn" lay-submit lay-filter="sub_number">提交</a>
            </div>
        </div>
    </form>
    <!--购买记录弹出框-->
    <form id="pay_record" style="display: none;">
        <div class="layui-col-md12">
            <table id="pageTablePay" lay-filter="pageTablePay" lay-data="{id: 'pageTablePay'}"></table>
        </div>
    </form>
    <form class="layui-form" id="partner" style="display: none;">
        <div class="layui-form-item" style="margin-top: 1.25rem;">
            <label class="layui-form-label">合伙人数量</label>
            <div class="layui-input-inline">
                <input name="partner_number" value="0" required autocomplete="off" lay-verify="required" placeholder="请输入合伙人数量"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <a class="layui-btn" lay-submit lay-filter="partner_sub">提交</a>
            </div>
        </div>
    </form>
</div>
<!--表格工具条-->
<script type="text/html" id="operations">
    <a class="layui-btn layui-btn-xs" lay-event="app_list">应用</a>
    <a class="layui-btn layui-btn-xs" lay-event="app_number">应用数量设置</a>
    {{# if(d.source == 1){ }}
        <a class="layui-btn layui-btn-xs" lay-event="pay_record">购买记录</a>
    {{# } }}
</script>
<!--表格工具条-->
<script type="text/html" id="operationsApp">
    <a class="layui-btn layui-btn-xs" lay-event="合伙人">合伙人</a>
    <a class="layui-btn layui-btn-xs" lay-event="短信">短信充值</a>
    <a class="layui-btn layui-btn-xs" lay-event="订单">订单充值</a>
</script>
<script>
    layui.use('users/merchant/list', layui.factory('users/merchant/list'));
</script>
<!--状态码模板-->
<script type="text/html" id="statusTpl">
    <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{
           (d.status==1) ? 'checked' : '' }}>
</script>
<!--微信支付开关模板-->
<script type="text/html" id="paySwitchTpl">
    <input type="checkbox" name="pay_switch" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="pay_switch"
           {{
           (d.pay_switch==1) ? 'checked' : '' }}>
</script>
<!--图片模板-->
<script type="text/html" id="imgTpl">
    <img class="layui-upload-img" style="width:40px; height:40px"
         src={{ d.pic_url }}>
</script>
<!--自定义版权状态模板-->
<script type="text/html" id="copyrightTpl">
    <input type="checkbox" name="copyright" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="copyright"
           {{
           (d.copyright==1) ? 'checked' : '' }}>
</script>
<style>
    #pay_record .layui-table-cell {
        width: 200px;
    }
</style>
